<?php


namespace App\Models\Insure;

use App\Models\Model;

class Insure extends Model
{
    protected $table = 'akbus_Insure';

    protected $fillable = [
        'bus_id',
        'merc_company',
        'merc_money',
        'merc_time',
        'merc_start_date',
        'merc_end_date',
        'force_time',
        'force_money',
        'force_start_date',
        'force_end_date',
        'liability_money',
        'liability_seat_num',
        'liability_time',
        'liability_start_date',
        'liability_end_date',
        'created_at',
        'updated_at',
    ];

    /**
     * 不可批量赋值的属性。
     *
     * @var array
     */
    protected $guarded = [
    ];

    /**
     * 类型转化
     *
     * @var array
     */
    protected $casts = [
    ];

    /**
     * 隐藏的字段
     *
     * @var array
     */
    protected $hidden = [
    ];

    /**
     * 拼接车牌号字符
     *
     * @param  string  $value
     *
     * @return string
     */
    public function getLicensePlateNumAttribute($value)
    {
        return '陕G'.$value;
    }

    /**
     * 附件上传
     */
    public function file()
    {
        return $this->hasMany('App\Models\Insure\InsureFile', 'insure_id');
    }
}
